package net.yxsoft.controller.pc.sysmgt;

import com.jfinal.aop.Clear;
import net.yxsoft.controller.pc.sysmgt.common.AuthController;
import net.yxsoft.service.NodeAccountService;
import rapid.core.Authuser;
import rapid.core.TResult;

public class NodeAccountController  extends AuthController {

    private static final NodeAccountService svr=NodeAccountService.INSTANCE;

    public void index() {
        render("index.html");
    }
    /**
     * 新增账号
     *  name
     * account
     * password
     * groupIds
     * roleIds
     * */
    @Clear
    public void createAccount(){
        String name = get("name");//名称
        String account = get("account");//账号
        String password = get("password");//密码
        String groupIds = get("groupIds");//组织
        String roleIds = get("roleIds");//角色
        Authuser loginUser = getLoginUser();
        TResult tResult = svr.createAccount(name, account, password, groupIds, roleIds, loginUser);
        renderJson(tResult);
    }
}
